package com.rpc.example.constant;

public enum RegisterType {
    zookeeper((byte) 1),

    euraka((byte) 2),
    nacos((byte) 3),

    ;
    private final byte code;

    public byte getCode() {
        return this.code;
    }


    RegisterType(byte code) {
        this.code = code;
    }


    public static RegisterType findByCode(byte code) {
        for (RegisterType value : RegisterType.values()) {
            if (value.getCode() == code) {
                return value;
            }
        }
        throw new IllegalArgumentException("illegal request type code: " + code);
    }
}
